{% extends "base_1col.html" %}

{% block content %}

{% if results %}

  <p>You search for: <strong>"{{ query }}"</strong>. </p> 


    {% for object in results %}
      <div class="post">
        <div class="title">
           <h2><a href="{{ object.get_absolute_url }}">{{ object.title|safe }}</a></h2>
           <p class="date small">Posted by <strong>{{ object.author }}</strong> on {{ object.pub_date|date:"F j, Y" }}</p>
       </div>
        
        <div class="entry">
           {{ object.body_html|truncatewords_html:"200"|safe }}
        </div>
      </div>    
{% endfor %}

{% else %}

  {% if query %}
    <p>You search for: <strong>"{{ query }}"</strong> </p> <br> No results found.</p>
  {% else %}
    <p>Type a search query into the box above, and press "Submit" to search.</p>
  {% endif %}

{% endif %}

{% endblock %}